<template>
  <div class="block">
    <el-table :data="tableData" style="width: 100%">
      <el-table-column prop="gid" label="编号" width="180"> </el-table-column>
      <el-table-column prop="gname" label="品名" width="180"> </el-table-column>
      <el-table-column prop="gsize" label="规格" width="180"> </el-table-column>
      <el-table-column prop="gremark" label="备注"> </el-table-column>
    </el-table>
    <div class="block">
      <span class="demonstration">默认</span>
      <el-date-picker v-model="value1" type="date" placeholder="选择日期">
      </el-date-picker>
    </div>
    <div>
      <i class="fa fa-camera fa-4x" aria-hidden="true">恭喜发财</i>
    </div>
  </div>
</template>

  <script>
export default {
  created: function () {
    this.$http.get("/good").then(response =>{
      this.tableData = response.data;
    });
  },
  data() {
    return {
      tableData: [],
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() > Date.now();
        },
        shortcuts: [
          {
            text: "今天",
            onClick(picker) {
              picker.$emit("pick", new Date());
            },
          },
          {
            text: "昨天",
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24);
              picker.$emit("pick", date);
            },
          },
          {
            text: "一周前",
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", date);
            },
          },
        ],
      },
      value1: "",
      value2: "",
    };
  },
};
</script>